/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.material.service;

import org.springblade.modules.material.entity.PaperEntity;
import org.springblade.modules.material.vo.GetPaperDetailVO;
import org.springblade.modules.material.vo.GetPaperVO;
import org.springblade.modules.material.vo.PaperReleaseDetailVO;
import org.springblade.modules.material.vo.PaperVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * 试卷表 服务类
 *
 * @author
 * @since 2023-03-22
 */
public interface IPaperService extends BaseService<PaperEntity> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param paper
	 * @return
	 */
	IPage<PaperVO> selectPaperPage(IPage<PaperVO> page, PaperVO paper);


	/**
	 * 获取试卷的所有内容
	 *
	 * @param paper
	 * @return
	 */
	GetPaperVO getPaper(PaperEntity paper);

	/**
	 * 将数据按照题目类型分组 并按照单选、多选、判断、填空、简答的顺序返回  每周题目的顺序按照创建时间升序
	 */
	List<GetPaperDetailVO> sortPaperDetailByQuestionType(List<GetPaperDetailVO> list);

	/**
	 * 将数据按照题目类型分组 并按照单选、多选、判断、填空、简答的顺序返回  每周题目的顺序按照创建时间升序
	 */
	List<PaperReleaseDetailVO> sortExamPaperDetailByQuestionType(List<PaperReleaseDetailVO> list);

	/**
	 * 根据题目类型分类处理题目
	 */
	List<PaperReleaseDetailVO> dealQuestionByQUestionType(List<PaperReleaseDetailVO> list);

	/**
	 * 恢复已被删除的试卷  逻辑恢复
	 * @param id
	 * @return
	 */
	boolean paperRestore(Long id);
}
